package com.xbs.utils;

import java.util.List;

public class PageUtilEntity<T> {
	/**
	 * 页面的数据
	 */
	private List<T> ist;
	/**
	 * 当前第几页
	 */
	private Integer currpage;
	/**
	 * 一共多少页
	 */
	private Integer pageNum;
	/**
	 * 每页记录数
	 */
	private Integer pageSize;
	/**
	 * 总记录数
	 */
	private Integer sumRecord;
	
	
	public List<T> getIst() {
		return ist;
	}
	public void setIst(List<T> ist) {
		this.ist = ist;
	}
	public Integer getCurrpage() {
		return currpage;
	}
	public void setCurrpage(Integer currpage) {
		this.currpage = currpage;
	}
	public Integer getPageNum() {
		if(sumRecord==null){
			return 0;
		}
		return sumRecord/pageSize+1;
	}
	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getSumRecord() {
		
		return sumRecord;
	}
	public void setSumRecord(Integer sumRecord) {
		this.sumRecord = sumRecord;
	}
	
	/**
	 * 判断是否有下一页
	 */
	public boolean hasNext(){
		if(currpage>=pageNum){
			return false;
		}
		return true;
	}
	/**
	 * 判断是否有上一页
	 */
	public boolean hasPrev(){
		if(currpage==1){
			return false;
		}
		return true;
	}

	
	
}
